;*******************************************************************************
; (C) 2006 Keith S. Robertson - IE.INC
;-------------------------------------------------------------------------------
;
; Prototypes, Includes & Data Related to Root level IE funtions used by all
;
;*******************************************************************************



;-------------------------------------------------------------------------------
; DEFINED CONSTANTS
;-------------------------------------------------------------------------------


;============================================
; IE Game Contants
;--------------------------------------------
; Baldurs Gate
BG1										equ 1	
BG1_SAGA								equ 1
BALDURS_GATE							equ 1
BALDURS_GATE_1							equ 1
BALDURS_GATE_ORIGINAL_SAGA				equ 1

; Baldurs Gate: Tales of The Sword Coast
TOTSC									equ 2
BG1_TOTSC								equ 2
BALDURS_GATE_TOTSC						equ 2
TALES_OF_THE_SWORD_COAST				equ 2
BALDURS_GATE_TALES_OF_THE_SWORD_COAST	equ 2

; Baldurs Gate 2: Shadows of Amn
SOA										equ 3
BG2										equ 3
BGII									equ 3
BG2_SOA									equ 3
BALDURS_GATE_II_SOA						equ 3
BALDURS_GATE_2_SOA						equ 3
SHADOWS_OF_AMN							equ 3
BALDURS_GATE_II_SHADOWS_OF_AMN			equ 3
		
; Baldurs Gate 2: Throne of Bhaal
TOB										equ 4
BG2_TOB									equ 4
BALDURS_GATE_II_TOB						equ 4
BALDURS_GATE_2_TOB						equ 4
THRONE_OF_BHAAL							equ 4
BALDURS_GATE_II_THRONE_OF_BHAAL			equ 4

; Icewind Dale
DALE									equ 5
IWD										equ 5
IWD1									equ 5
IWD1_DALE								equ 5
ICEWIND_DALE							equ 5

; Icewind Dale: Heart of Winter
HOW										equ 6
IWD_HOW									equ 6
IWD1_HOW								equ 6
ICEWIND_DALE_HOW						equ 6
HEART_OF_WINTER							equ 6
ICEWIND_DALE_HEART_OF_WINTER			equ 6

; Icewind Dale: HoW: Trials of The Luremaster
TOTL									equ 7
IWD_TOTL								equ 7
IWD1_TOTL								equ 7
ICEWIND_DALE_TOTL						equ 7
TRIALS_OF_THE_LUREMASTER				equ 7
ICEWIND_DALE_TRIALS_OF_THE_LUREMASTER	equ 7

; Icewind Dale II
DALE2									equ 8
IWD2									equ 8
IWDII									equ 8
ICEWIND_DALE_II							equ 8

; Planescape Torment
PST										equ 9
TORMENT									equ 9
PLANESCAPE								equ 9
PLANESCAPE_TORMENT						equ 9

;============================================
		
IE_ACCESS_FILE		equ 0
IE_ACCESS_MEMORY	equ 1

KEY_ACCESS_FILE		equ 0
KEY_ACCESS_MEMORY	equ 1

BIF_ACCESS_FILE		equ 0
BIF_ACCESS_MEMORY	equ 1


;-------------------------------------------------------------------------------
; Structures
;-------------------------------------------------------------------------------

INFINITY_ENGINE_GAMES	STRUCT
	BG1_SAGA_INSTALLED	dd	0
	BG1_SAGA_PATH		db 	MAX_PATH dup (0)
	BG1_TOTSC_INSTALLED	dd	0
	BG1_TOTSC_PATH		db 	MAX_PATH dup (0)
	BG2_SOA_INSTALLED	dd	0
	BG2_SOA_PATH		db 	MAX_PATH dup (0)
	BG2_TOB_INSTALLED	dd	0
	BG2_TOB_PATH		db 	MAX_PATH dup (0)
	IWD1_INSTALLED		dd	0
	IWD1_PATH			db 	MAX_PATH dup (0)
	IWD1_HOW_INSTALLED	dd	0
	IWD1_HOW_PATH		db	MAX_PATH dup (0)
	IWD1_TOTL_INSTALLED	dd	0
	IWD1_TOTL_PATH		db 	MAX_PATH dup (0)
	IWD2_INSTALLED		dd	0
	IWD2_PATH			db 	MAX_PATH dup (0)
	PST_INSTALLED		dd	0
	PST_PATH			db 	MAX_PATH dup (0)
INFINITY_ENGINE_GAMES	ENDS

;IEGAMES	 				TYPEDEF PTR INFINITY_ENGINE_GAMES

BIFF_HEADER				STRUCT
	Signature			DD	?
	Version				DD	?
	FileEntries			DD	?
	TileEntries			DD	?
	FileEntriesOffset	DD	?
BIFF_HEADER				ENDS

BIF__HEADER				STRUCT
	Signature			DD	?
	Version				DD	?
	LengthFilename		DD	?
BIF__HEADER				ENDS

BIFC_HEADER				STRUCT
	Signature			DD	?
	Version				DD	?
	UncompressedBIFSize	DD	?

BIFC_HEADER				ENDS

BIFF_FILE_ENTRY_RECORD	STRUCT
	ResLocator			DD		?
    ResOffset			DD		?
    ResSize				DD		?
    ResType				DD		?
BIFF_FILE_ENTRY_RECORD	ENDS


BIFF_TILE_ENTRY_RECORD	STRUCT
	ResLocator			DD		?
    ResOffset			DD		?
    ResNoTiles			DD		?
    ResSize				DD		?
    ResType				DD		?
BIFF_TILE_ENTRY_RECORD	ENDS


;-------------------------------------------------------------------------------
; IE Prototypes
;-------------------------------------------------------------------------------
IEOpenFile				PROTO 	:DWORD
IECloseFile				PROTO 	:DWORD

IEFileSignature			PROTO 	:DWORD, :DWORD, :DWORD
IEFileVersion			PROTO 	:DWORD, :DWORD, :DWORD

IEDetectGames			PROTO 	:DWORD
IEIsGameInstalled		PROTO 	:DWORD, :DWORD
IEGamePath				PROTO	:DWORD, :DWORD, :DWORD

;-------------------------------------------------------------------------------
; BIF Prototypes
;-------------------------------------------------------------------------------
BIFOpenFile				PROTO	:DWORD
BIFCloseFile			PROTO	:DWORD

BIFReadHeader			PROTO	:DWORD, :DWORD
BIFReadBody				PROTO	:DWORD, :DWORD
BIFReadFile				PROTO	:DWORD, :DWORD

BIFIsCompressed			PROTO	:DWORD, :DWORD
BIFUncompress			PROTO	:DWORD, :DWORD
BIFUncompressedSize		PROTO	:DWORD, :DWORD, :DWORD
BIFCompressedSize		PROTO	:DWORD, :DWORD, :DWORD
BIFCompressedName		PROTO	:DWORD, :DWORD, :DWORD
BIFCompressedType		PROTO	:DWORD, :DWORD, :DWORD
BIFCompressedData		PROTO	:DWORD, :DWORD, :DWORD

BIFNoFileEntries		PROTO	:DWORD, :DWORD, :DWORD
BIFNoTileEntries		PROTO	:DWORD, :DWORD, :DWORD

BIFFileEntriesOffset 	PROTO	:DWORD, :DWORD, :DWORD
BIFFileEntryResLocator 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFFileEntryResOffset 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFFileEntryResSize 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFFileEntryResType 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFFileEntry			PROTO	:DWORD, :DWORD, :DWORD, :DWORD

BIFTileEntriesOffset 	PROTO	:DWORD, :DWORD, :DWORD
BIFTileEntryResLocator 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFTileEntryResOffset 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFTileEntryResSize 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFTileEntryResType 	PROTO	:DWORD, :DWORD, :DWORD, :DWORD
BIFTileEntry			PROTO	:DWORD, :DWORD, :DWORD, :DWORD





	
	